[% PROCESS settings/header.html %]
[% IF prefs %]
[% FOREACH id = [1 .. max] %]
	<div class="settingSection">

		<div class="groupHead">[% "PLUGIN_ALARM" | string | upper %] [% IF prefs.name.$id %] - [% prefs.name.$id | upper %][% ELSE %][% alarmid.$id %][% END %]</div>
		<div class="groupDesc">[% "PLUGIN_ALARM_GROUP_DESC" | string %]</div>

		<table>
		
		<tr>
			<td><label for="active[% id %]" class="stdlabel">[% "SETUP_ALARM" | string %] [% "ENABLED" | string %][% "COLON" | string %]</label></yd>
			<td><input type="checkbox" [% IF prefs.active.$id %]checked [% END %] class="stdedit" name="active[% id %]" id="active[% id %]" /></td>

			<!--<td><select class="stdedit" name="alarm[% id %]" id="alarm[% id %]">

			[% FOREACH option = {
				'1'   => 'ON',
				'0'   => 'OFF',
			} %]
				<option [% IF prefs.alarm.$id == option.key %]selected [% END %]value="[% option.key %]">[% option.value | string %]</option>
			[%- END -%]
			</select></td>-->
		</tr>
		
		<tr>
			<td><label for="name[% id %]" class="stdlabel">[% "PLUGIN_ALARM_NAME" | string %][% "COLON" | string %]</label></td>
			<td><input type="text" class="stdedit" name="name[% id %]" id="name[% id %]" value="[% prefs.name.$id %]" size="15"></td>
		</tr>

		<tr>
			<td><label for="time[% id %]" class="stdlabel">[% "ALARM_SET" | string %] [% alarmid.$id %][% "COLON" | string %]</label></td>
			<td><input type="text" class="stdedit" name="time[% id %]" id="time[% id %]" value="[% prefs.time.$id %]" size="15"></td>
		</tr>

		<tr>
			<td><label for="duration[% id %]" class="stdlabel">[% "PLUGIN_ALARM_DURATION" | string %][% "COLON" | string %]</label></yd>
			<td><select class="stdedit" name="duration[% id %]" id="duration[% id %]">
	
			[% FOREACH option = ['0', '15', '30', '45', '60', '90', '120', '150', '180'] %]
				<option [% IF prefs.duration.$id == option %]selected [% END %]value="[% option %]">[% IF option %][% option %][% ELSE %][% 'PLUGIN_ALARM_NOEND' | string %][% END %]</option>
			[%- END -%]
			</select></td>
		</tr>

		<tr>
			<td><label for="volume[% id %]" class="stdlabel">[% "SETUP_ALARMVOLUME" | string %][% "COLON" | string %]</label></td>
			<td><input type="text" class="stdedit" name="volume[% id %]" id="alarmvolume[% id %]" value="[% prefs.volume.$id %]" size="15"></td>
		</tr>
		
		<tr>
			<td><label for="fadeseconds[% id %]" class="stdlabel">[% "PLUGIN_ALARM_FADESECONDS" | string %][% "COLON" | string %]</label></td>
			<td><input type="text" class="stdedit" name="fadeseconds[% id %]" id="fadeseconds[% id %]" value="[% prefs.fadeseconds.$id %]" size="15"></td>
		</tr>

		[% IF prefs.exists('alarmShowClock') %]
		<tr>
			<td><label for="showclock[% id %]" class="stdlabel">[% "PLUGIN_ALARM_SHOWCLOCK" | string %][% "COLON" | string %]</label></yd>
			<td><input type="checkbox" [% IF prefs.showclock.$id %]checked [% END %] class="stdedit" name="showclock[% id %]" id="showclock[% id %]" /></td>

		</tr>
		[% END %]


		<tr>
			<td><label for="days[% id %]" class="stdlabel">[% "PLUGIN_ALARM_DAYS" | string %][% "COLON" | string %]</label></yd>
			<td><select class="stdedit" name="days[% id %]" id="days[% id %]">
	
			[% FOREACH option = {
				'0'  => 'PLUGIN_ALARM_DAYS_ALL',
				'1'  => 'PLUGIN_ALARM_DAYS_1',
				'2'  => 'PLUGIN_ALARM_DAYS_2',
				'3'  => 'PLUGIN_ALARM_DAYS_3',
				'4'  => 'PLUGIN_ALARM_DAYS_4',
				'5'  => 'PLUGIN_ALARM_DAYS_5',
				'6'  => 'PLUGIN_ALARM_DAYS_6',
				'7'  => 'PLUGIN_ALARM_DAYS_7',
				'8'  => 'PLUGIN_ALARM_DAYS_WEEK'
				'9'  => 'PLUGIN_ALARM_DAYS_END',
				'10' => 'PLUGIN_ALARM_DAYS_ONCE',
				'11' => 'PLUGIN_ALARM_DAYS_DATE',
			} %]
				<option [% IF prefs.days.$id == option.key %]selected [% END %]value="[% option.key %]">[% option.value | string %]</option>
			[%- END -%]
			</td>
		</tr>

		<tr>
			<td><label for="dayofmonth[% id %]" class="stdlabel">[% "PLUGIN_ALARM_DAYOFMONTH" | string %][% "COLON" | string %]</label></td>
			<td><input type="text" class="stdedit" name="dayofmonth[% id %]" id="dayofmonth[% id %]" value="[% prefs.dayofmonth.$id %]" size="15"></td>
		</tr>

		<tr>
			<td><label for="month[% id %]" class="stdlabel">[% "PLUGIN_ALARM_MONTH" | string %][% "COLON" | string %]</label></yd>
			<td><select class="stdedit" name="month[% id %]" id="month[% id %]">
	
			[% FOREACH option = [0..11] %]
				<option [% IF prefs.months.$id == option %]selected [% END %]value="[% option %]">[% "PLUGIN_ALARM_MONTH_$option" | string %]</option>
			[%- END -%]
			</select></td>
		</tr>
		
		<tr>
			<td><label for="playlist[% id %]" class="stdlabel">[% "ALARM_SELECT_PLAYLIST" | string %][% "COLON" | string %]</label></td>
			<td><select class="stdedit" name="playlist[% id %]" id="playlist[% id %]">
	
			[% FOREACH option = playlistOptions  %]
				<option [% IF prefs.playlist.$id == option.key %]selected [% END %]value="[% option.key %]">[% option.value %]</option>
			[%- END -%]
			
			</select></td>
		</tr>
		
		<tr>
			<td><label for="autoshuffle[% id %]" class="stdlabel">[% "PLUGIN_ALARM_AUTOSHUFFLE" | string %][% "COLON" | string %]</label></yd>
			<td><input type="checkbox" [% IF prefs.autoshuffle.$id %]checked [% END %] class="stdedit" name="autoshuffle[% id %]" id="autoshuffle[% id %]" /></td>

		</tr>
		
		</table>

	</div>
[% END %]
	<p>
	<input name="AddAlarm" type="submit" class="stdclick" value="[% "ADD" | string %]">
	<input name="RemoveLast" type="submit" class="stdclick" value="[% "PLUGIN_ALARM_DELETE_LAST" | string %]">
	</p>
[% END %]
[% PROCESS settings/footer.html %]
